package org.shop.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.shop.dao.SupplierGoodsMapper;
import org.shop.entity.SupplierGoods;
import org.shop.service.SupplierGoodsService;
import org.shop.service.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class SupplierGoodsServiceImpl extends BaseServiceImpl<SupplierGoods, Long> implements SupplierGoodsService{
	@Autowired
	private SupplierGoodsMapper supplierGoodsMapper;
	
	@Override
	public Map<String, Object> getSupplierGoodsList(Map<String, Object> paramMap) {
		List<Map<String, Object>> supplierGoodsList = supplierGoodsMapper.getSupplierGoodsList(paramMap);
        Integer count = supplierGoodsMapper.getSupplierGoodsCount(paramMap);
        //分页数据
        Map<String, Object> dataMap = new HashMap<String, Object>();
        dataMap.put("total", count);
        dataMap.put("rows", supplierGoodsList);
        return dataMap;
	}

	@Override
	public Map<String, Object> getUserIdByOrderId(Long orderId) {
		return supplierGoodsMapper.getUserIdByOrderId(orderId);
	}

	@Override
	public Map<String, Object> getGoodsInfoBySupplierGoodsId(Long supplierGoodsId) {
		
		return supplierGoodsMapper.getGoodsInfoBySupplierGoodsId(supplierGoodsId);
	}
	
}